{include file="public/hunanconstr_meta" /}
<link href="__PUBLIC_ADMIN__css/plugins/iCheck/custom.css" rel="stylesheet">
</head>

<body class="gray-bg">
    
            <div class="col-sm-12">
                <div class="tabs-container">
                    <div class="ibox-title">
                        <h5>编辑</h5>
                        
                        <div class="ibox-tools">
                            <a href="{:url('admin/Hunanconstr/project_list')}" class="btn btn-primary btn-xs">返回列表</a>
                        </div>
                    </div>
                                        
                    <div class="tab-content">
                        <ul class="nav nav-tabs">
	                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">基本信息</a></li>
	                        <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">项目</a></li>
                        </ul>
                        <div id="tab-1" class="tab-pane active" >
                            <div class="row" >
					            <div class="col-sm-9">
					                <div class="ibox float-e-margins">
					                    <div class="ibox-content">
					                        <form action="{:url('admin/Hunanconstr/project_edit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
					                            <input type="hidden" name="id" value="{$res.id}" />
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">项目名称</label>
					                                <div class="col-sm-10">
					                                    <input type="text" class="form-control" value="{$res.project_name}" name="project_name">
					                                </div>
					                            </div>
					                            <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">模型图</label>
					                            <div class="up" style="margin-left: 15px;">
							                        <input type="file" name="image" class="one"  id="image">
							                        <div id="preview1">
							                            <img src="{$res.project_model}" alt="image" style="width:150px;height:100px">
							                        </div>
							                    </div>
							                    </div>
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">项目编号</label>
					                                <div class="col-sm-4">
					                                    <input type="text" class="form-control" value="{$res.project_no}" name="project_no">
					                                </div>
					                            </div>
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">所属企业</label>
					                                  <div class="col-sm-2">
					                                        <select class="form-control" id="company_id" name="company_id">
					                                        {foreach name="rest" id="vo" key="key"}
					                                            <option value="{$vo.id}">{$vo.company_name}</option>
					                                        {/foreach}
					                                        </select>
					                                  </div>
					                            </div>
					                            <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">楼栋数</label>
                                                    <div class="col-sm-4">
                                                        <input type="text" class="form-control" value="{$res.can_count}" name="can_count">
                                                    </div>
                                                </div>
					                            <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">计划竣工时间</label>
                                                    <div class="col-sm-4">
                                                        <input type="text" class="form-control" value="{$res.plan_finish_time}" name="plan_finish_time">
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">项目进度(%)</label>
                                                    <div class="col-sm-4">
                                                        <input type="text" class="form-control" value="{$res.progress}" name="progress" disabled="disabled" >
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
											    <div class="form-group">
											        <label class="col-sm-2 control-label">项目状态</label>
											        <div class="col-sm-4">
											            <select class="form-control" name="project_status">
											                <option {if condition="$res.project_status eq 1"} selected = "selected" {/if}  value="1" name="project_status">正常</option>
											                <option {if condition="$res.project_status eq 2"} selected = "selected" {/if}  value="2" name="project_status">完成</option>
											                <option {if condition="$res.project_status eq 0"} selected = "selected" {/if}  value="0" name="project_status">滞后</option>
											            </select>
											        </div>
											    </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">合同状态</label>
                                                    <div class="col-sm-4">
                                                        <select class="form-control" name="pact_status">
                                                            <option {if condition="$res.pact_status eq 1"} selected = "selected" {/if}  value="1" name="pact_status">已签署</option>
                                                            <option {if condition="$res.pact_status eq 0"} selected = "selected" {/if}  value="0" name="pact_status">未签署</option>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">开工状态</label>
                                                    <div class="col-sm-4">
                                                        <select class="form-control" name="start_work">
                                                            <option {if condition="$res.start_work eq 1"} selected = "selected" {/if}  value="1" name="start_work">已开工</option>
                                                            <option {if condition="$res.start_work eq 0"} selected = "selected" {/if}  value="0" name="start_work">未开工</option>
                                                        </select>
                                                    </div>
                                                </div>
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <div class="col-sm-4 col-sm-offset-2">
					                                    <button class="btn btn-primary" type="submit">保存内容</button>
					                                </div>
					                            </div>
					                        </form>
					                    </div>
					                </div>
					            </div>
					        </div>
                        </div>

                        <div id="tab-4" class="tab-pane">
                             <div class="row" >
                                <div class="col-sm-9">
                                    <div class="ibox float-e-margins">
                                        <div class="ibox-content">
                                            <form action="{:url('admin/Hunanconstr/project_cat_edit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
                                                <input type="hidden" name="id" value="{$res.id}" />
                                                <div class="form-group">
					                                <label class="col-sm-2 control-label">项目地址(省)</label>
					                                <div class="col-sm-10">
						                                <select class="form-control" id="province_id" name="province_id">
					                                        <option value="430000">湖南省</option>
					                                    </select>
				                                    </div>
					                            </div>
					                            
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">项目地址(市)</label>
                                                    
                                                    <div class="col-sm-10">
						                                <select class="form-control" id="city_id" name="city_id">
					                                        {foreach $citys as $value}
					                                        <option value="{$value.id}">{$value.name}</option>
					                                        {/foreach}
					                                    </select>
				                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">项目地址(街道)</label>
                                                    <div class="col-sm-4">
                                                        <input type="text" class="form-control" value="{$res.address}" name="address">
                                                        <span class="help-block m-b-none">*例:天心区XXX街道</span>
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">项目经度</label>
					                                <div class="col-sm-10">
					                                    <input type="text" class="form-control" value="{$res.lng}" name="lng">
					                                </div>
					                            </div>
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">项目纬度</label>
					                                <div class="col-sm-10">
					                                    <input type="text" class="form-control" value="{$res.lat}" name="lat">
					                                </div>
					                            </div>
                                                 <div class="hr-line-dashed"></div>
					                            <!-- <div class="form-group">
					                                <label class="col-sm-2 control-label">施工单位</label>
					                                <div class="col-sm-10">
					                                    <input type="text" class="form-control" value="{$res.construction_unit}" name="construction_unit">
					                                </div>
					                            </div> -->
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">建设单位</label>
					                                <div class="col-sm-10">
					                                    <input type="text" class="form-control" value="{$res.design_unit}" name="design_unit">
					                                </div>
					                            </div>
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">设计单位</label>
					                                <div class="col-sm-10">
					                                    <input type="text" class="form-control" value="{$res.contract_unit}" name="contract_unit">
					                                </div>
					                            </div>
					                            <div class="hr-line-dashed"></div>
					                            <div class="form-group">
					                                <label class="col-sm-2 control-label">监理单位</label>
					                                <div class="col-sm-10">
					                                    <input type="text" class="form-control" value="{$res.supervisor_unit}" name="supervisor_unit">
					                                </div>
					                            </div>
					                            <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">总建筑面积</label>
                                                    <div class="col-sm-10">
                                                        <input type="text" class="form-control" value="{$res.total_area}" name="total_area">
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">工程造价</label>
                                                    <div class="col-sm-10">
                                                        <input type="text" class="form-control" value="{$res.finished_output}" name="finished_output">
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">主体完工面积</label>
                                                    <div class="col-sm-10">
                                                        <input type="text" class="form-control" value="{$res.finished_area}" name="finished_area">
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">装修完工面积</label>
                                                    <div class="col-sm-10">
                                                        <input type="text" class="form-control" value="{$res.renovation_area}" name="renovation_area">
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">累计完成产值</label>
                                                    <div class="col-sm-10">
                                                        <input type="text" class="form-control" value="{$res.recovery_money}" name="recovery_money">
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <div class="col-sm-4 col-sm-offset-2">
                                                        <button class="btn btn-primary" type="submit">保存内容</button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                    
                                </div>
                            </div>
                        </div>

                        </div>
                    </div>
                </div>
            
        <!-- <div class="col-sm-2">
            <div class="ibox-title" style="margin-top:9px;float: right;width:260px;height:280px">
	            <h>项目模型图</h>
	            <form action="{:url('admin/Hunanconstr/thumb_model',['id'=>$res.id])}" method="post" id="update_model{$res.id}">
		       
			         <div class="up" style="margin-left: 15px;">
                        <input type="file" name="image" class="image" onchange="update_model({$res.id})">
                        <div id="preview1">
                            <img src="{$res.project_model}" alt="image" id="images{$res.id}" style="width:180px;height:150px">
                        </div>
                    </div>
			    
			    </form>
            </div>
        </div> 
    </div>
    {include file="public/hunanconstr_footer" /}
	
    <!-- 自定义js -->
    <script src="__PUBLIC_ADMIN__js/content.js?v=1.0.0"></script>
    
    <!-- iCheck -->
    <script src="__PUBLIC_ADMIN__js/plugins/iCheck/icheck.min.js"></script>
    
    <script>
    	$("#company_id").val("{$res.company_id}");
    	$("#city_id").val("{$res.city_id}");
    
         function upload_img(id){
             var form = new FormData(document.getElementById("update_img"+id));
                                                      
              $.ajax({
                  url:"/admin/Hunanconstr/thumb_de?id="+id,
                  type:"post",
                  data:form,
                  processData:false,
                  contentType:false,
                  success:function(data){
                      $("#image" + id).attr("src", "http://wx.hncegbim.com/"+data);
                  },
                  error:function(e){
                      alert("错误！！");
                      window.clearInterval(timer);
                  }
              });
         }
    </script>
    <script>
         function update_model(id){
             var form = new FormData(document.getElementById("update_model"+id));
                                                      
              $.ajax({
                  url:"/admin/Hunanconstr/thumb_model?id="+id,
                  type:"post",
                  data:form,
                  processData:false,
                  contentType:false,
                  success:function(data){
                      $("#images" + id).attr("src", ""+data);
                  },
                  error:function(e){
                      alert("错误！！");
                      window.clearInterval(timer);
                  }
              });
         }
    </script>
    
    <script>
        $(document).ready(function() {
        	$('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
			
            $('.refresh').click(function(){
            	window.location.reload();	// 刷新页面
            })
            
          	//iframe窗
          	$('.edit').click(function(){
          		var index = layer.open({
          			type : 2,
					fixed: true,
					scrollbar: false,
					title : '很多时候，我们想最大化看，比如像这个页面。',
					shadeClose : false,
					maxmin : true, //开启最大化最小化按钮
					area : ['893px', '600px'],
					//offset: '100px',
					content : '//www.wei-yong.com'
          		});
          		layer.full(index);
          	})
		});
	</script>
</body>
</html>
